/*
 * Copyright:  2018 smarabbit studio.
 *
 *  Licensed under the Confluent Community License; you may not use this file
 *  except in compliance with the License.  You may obtain a copy of the License at
 *
 *  http://www.confluent.io/confluent-community-license
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES OF ANY KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations under the License.
 *
 *  @作   者： 黄开晖 (117227773@qq.com)
 *  @日   期:  2020年9月4日
 */
package com.massyframework.beanskin.runtime.service.filting;

import java.util.Map;

import com.massyframework.beanskin.service.Filter;
import com.massyframework.beanskin.service.ServiceReference;

/**
 * {@link EmptyFilter} 提供一个Filter的占位符，它不执行任何匹配处理
 * 
 * @author huangkh
 */
public final class EmptyFilter implements Filter {

	private static final  EmptyFilter INSTANCE = new EmptyFilter();

    /**
     * 获取{@link EmptyFilter}实例
     * @return {@link EmptyFilter}
     */
    public static EmptyFilter getInstance(){
        return INSTANCE;
    }

    private EmptyFilter(){

    }

    /**
     * 对map进行过滤，对map的key和value进行不区分大小写匹配。
     *
     * @param props {@link Map}属性
     * @return {@code true}匹配，{@code false}不匹配
     */
    @Override
    public boolean match(Map<String, Object> props) {
        return true;
    }

    /**
     * 对服务引用进行过滤，对reference的属性名和属性值进行不区分大小写进行匹配
     *
     * @param reference {@link ServiceReference}
     * @return {@code true}匹配，{@code false}不匹配
     */
    @Override
    public <S> boolean match(ServiceReference<S> reference) {
        return true;
    }

}
